<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'comments.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
		.pagebar {
		padding: 0.2em 0.5em;
		margin-right: 0.1em;
		margin-bottom: 1.0em;
		border: 1px solid #fff;
		background: #fff;
		text-decoration: none;
		text-align: left;
	}
	
	.pagebar a,.pageList .this-page {
		border: 1px solid #9AAFE5;
		text-decoration: none;
		padding: 0.2em 0.5em;
	}
	
	.pagebar a:visited {
		border: 1px solid #9AAFE5;
		text-decoration: none;
		padding: 0.2em 0.5em;
	}
	
	.pagebar .break {
		padding: 2px 6px 2px 6px;
		border: none;
		background: #fff;
		text-decoration: none;
	}
	
	.pagebar .this-page {
		border: 1px solid #2E6AB1;
		padding: 0.2em 0.5em;
		font-weight: bold;
		background: #2E6AB1;
		color: #fff;
	}
	
	.pagebar a:hover {
		border-color: #2E6AB1;
	}
	
	.pagebar .inactive
	{
	   border: 1px solid #cccccc;
		 color: #ccc;
	   text-decoration: none;
	   padding: 0.2em 0.5em;
	}
	</style>
  </head>
  
  <body>
  <c:if test="${productComments == null}">
		<c:redirect url="/admin/product_allComments.action"/>
	</c:if>
  <div class="pagebar" align="left" >${pageStr}</div>	
  <c:forEach items="${productComments}" var="comment">
	  <table width="600" border="1">
	    <tr>
	      <td width="101">用户名</td>
	      <td width="483">${comment.users.UName }</td>
	    </tr>
	    <tr>
	    	<td>评论商品</td>
	    	<td>${ comment.products.PName }</td>
	    </tr>
	    <tr>
	      <td>评论时间</td>
	      <td><fmt:formatDate value="${comment.PCTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	    </tr>
	    <tr>
	      <td>内容</td>
	      <td>${comment.PCContent}</td>
	    </tr>
	    <tr>
	      <td colspan="2"><div align="right"><a href='/wsd/admin/product_deleteComment.action?cid=${comment.PCId}'>删除</a></div></td>
	    </tr>
	  </table>
	  <br/>
  </c:forEach>
  <div class="pagebar" align="left" >${pageStr}</div>
  </body>
</html>
